home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2485 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: nntp.teleport.com!craigl
  2. From: craigl@teleport.com (Craig Lovegren)
  3. Newsgroups: comp.programming,alt.msdos.programmer,comp.lang.c++
  4. Subject: Re: How to detect HD
  5. Date: 18 Jan 1996 00:42:22 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4dk51e$c6d@maureen.teleport.com>
  8. References: <4d5s19$m7l@nosy.bart.nl> <4de9g4$sc6@hades.rz.uni-sb.de> <4dh3tt$5lu@neptune.cs.trinity.edu>
  9. NNTP-Posting-Host: julie.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Megaman (trauschu@cs.trinity.edu) wrote:
  13. : B
  14. : > int get_nr_hds(void)
  15. : > {
  16. : >     int res = 0;
  17.  
  18. : >     printf("Hello User! Please open your computer and check the\n");
  19. : >     printf("number of HDs you have installed. Type that number: ");
  20. : >     fscanf(stdin, "%d", &res);
  21. : >     return res;
  22. : > }
  23.  
  24. : I must say this was the most entertaining message I have read here in a while.
  25. : All kidding aside, I have tried a few procedures for detecting the number
  26. : of drives, but is there any one way that is best (aside from the above) :-)
  27.  
  28. : Thomas
  29.  
  30. : --
  31. : -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  32. : "Hakuna Matata" - it means no worries. - "C'est la vie"
  33.  
  34. : Computer Science Major
  35. : 3D Graphics Interests
  36. : -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  37.  
  38. All kidding aside, why not check the multi-plexer.  Ask it to return the 
  39. number of CD-ROM drives installed.  If it returns more than zero then it 
  40. should tell you what the name of the first drive is.  For example, if I 
  41. had 2 hard-drives and at least one CD drive it would tell you, the first 
  42. CD is E:...  this would mean that the last writeable drive would be E - 1 
  43. or D:... you think?
  44.  
  45. Or... use a DOS function to return the number of bytes available... if it 
  46. is -1 there was a problem reading the drive, either CD or non-existing.
  47.  
  48. --
  49. Real Life: Craig R. Lovegren
  50. CyberLife: craigl@teleport.com
  51. IRC  Life: Son-Of-Yo
  52.